package com.lagou.edu.listener;

import com.lagou.edu.factory.AnnotationBeanFactory;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class ContextLoaderListener implements ServletContextListener {

    @Override
    public void contextInitialized(ServletContextEvent event) {
        try {
            AnnotationBeanFactory.newInstance().init();
            System.out.println("自定义容器加载成功");
        } catch (Exception e) {
            System.out.println("自定义容器加载失败" + e.getMessage());
        }
    }

    @Override
    public void contextDestroyed(ServletContextEvent event) {

    }

}
